package com.example.hp.myapplication.fragment;

import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.hp.myapplication.R;


/**
 * Created by M on 2018/5/11.
 */

public class Fragment1 extends Fragment {
    public Fragment1(){
        super();
    }
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.frag_sload,container,false);
        final  TextView tv = (TextView) view.findViewById(R.id.tv);
        view.findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
            int count = 0;
            @Override
            public void onClick(View v) {
               tv.setText(""+(++count));
            }
        });
        return  view;
    }

}
